package nciae.db.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class AdminController {


    @RequestMapping("/index")
    public String index(){
        return "admin/index";
    }

    @GetMapping("/classExpertIndex")
    public String classExpertIndex(){
        return "admin/classExpertIndex";
    }

    @GetMapping("/homeworkExpertIndex")
    public String homeworkExpertIndex(){
        return "admin/homeworkExpertIndex";
    }
    @GetMapping("/chargerindex")
    public String chargerindex(){
        return "admin/chargerindex";
    }

    @GetMapping("/SCuserIndex")
    public String SCuserIndex(){
        return "admin/SCuserIndex";
    }


    @RequestMapping(value = "/login", method = RequestMethod.GET)
    public ModelAndView login(){
        ModelAndView view = new ModelAndView();
        view.setViewName("admin/login");
        return view;
    }

    // 添加班级管理页面处理
    @RequestMapping("/class/index")
    public String classIndex(){
        return "class/index";  // 返回班级管理视图
    }

    @RequestMapping("/class/edit")
    public String classForm(){
        return "class/edit";
    }

    @RequestMapping("/class/students")
    public String classStudents(){
        return "class/students";
    }

    @RequestMapping("/course/index")
    public String courseIndex(){
        return "course/index";  // 返回班级管理视图
    }

    @RequestMapping("/student/index")
    public String studentIndex(){
        return "student/index";  // 返回学生管理视图
    }
    @RequestMapping("/homework/index")
    public String homeworkIndex(){
        return "homework/index";  // 返回作业管理视图
    }
    @RequestMapping("/homework/expert")
    public String homeworkExpert(){
        return "homework/expert";  // 返回作业批改视图
    }

}
